.auto-crud {
  display: flex;
  overflow: hidden;
  position: relative;
  border: solid 1px var(--lumo-contrast-20pct);
  height: 462px; /* vaadin-grid intrinsic 400px + 62px for the button toolbar */
}

.auto-crud > vaadin-split-layout {
  flex: 1 1 100%;
  max-width: 100%;
  align-items: stretch;
}

.auto-crud > vaadin-split-layout::part(splitter) {
  border-top: solid 1px var(--lumo-contrast-20pct);
  border-left: solid 1px var(--lumo-contrast-20pct);
}

.auto-crud-main {
  flex: 1 1 100%;
  min-width: 200px;
  display: flex;
  flex-direction: column;
}

.auto-crud-main > vaadin-grid {
  border: none;
  height: auto;
}

.auto-crud-toolbar {
  display: flex;
  flex-shrink: 0;
  align-items: baseline;
  justify-content: flex-end;

  padding: var(--lumo-space-s) var(--lumo-space-m);
  background-color: var(--lumo-contrast-5pct);
  border-top: solid 1px var(--lumo-contrast-10pct);
}

.auto-crud-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 40%;
  min-width: 300px;
}

/* Move box shadow and required z-index modification into pseudo-element
   as it otherwise messes with the drag handle of the split layout */
.auto-crud .auto-crud-form::before {
  content: "";
  pointer-events: none;
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 1;
  box-shadow: var(--lumo-box-shadow-s);
}

.auto-crud-form-header {
  padding: var(--lumo-space-m) var(--lumo-space-m) var(--lumo-space-s) var(--lumo-space-m);
}

.auto-crud .auto-form,
.auto-crud-dialog .auto-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1 1 0;
}

.auto-crud .auto-form-fields,
.auto-crud-dialog .auto-form-fields {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 0 var(--lumo-space-m);
}

.auto-crud .auto-form-toolbar,
.auto-crud-dialog .auto-form-toolbar {
  flex: 0 0 auto;
  padding: var(--lumo-space-s) var(--lumo-space-m);
  background-color: var(--lumo-contrast-5pct);
  border-top: 1px solid var(--lumo-contrast-10pct);
}

.auto-crud-dialog {
  --vaadin-overlay-viewport-inset: 0;
}

.auto-crud-dialog::part(overlay) {
  width: 100%;
  height: 100%;
  border-radius: 0;
}

.auto-crud-dialog::part(content) {
  padding: 0;
}

.auto-crud-dialog .auto-crud-dialog-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auto-crud-dialog .auto-form {
  width: 100%;
  height: 100%;
}
